<h2>Новости</h2>
<? if($this->dates!=false):?>
	<div id="news_years">
	<?php $url=preg_replace('/\/year\/.*\//ui','', $this->url);
		$url=preg_replace('/\/$/ui','', $url);
	?>
	<?php foreach ($this->dates as $year):?>
		<?php if($this->year!=$year):?>
		<a href="<?=$url.'/year/'.$year."/" ?>"><?=$year ?></a>
		<?php else:?>
		<span><?=$year ?></span>
		<?php endif;?>
	<?php endforeach;?>
	</div>
	<br/>
	
<?php endif; ?>

<? if($this->res!=false):?>

	<?php foreach ($this->res as $item):?>
		<?php 
		$date = new Zend_Date($item['date'],'yyyy-MM-dd');
		$date->setLocale('ru_RU');	
		$url = '/news/id/'.$item['id']."/";
		?>
	<div class="news_teaser clearfix">
		<a href='<?=$url?>' class="news_image">		
		<?php $images=explode(',', trim($item['images']));?>
			<?php if($images[0]):?>
			<?php $original = $this->image_Helper($images[0])->getUrl()?>
			<?php if (preg_match('/gif$/', $original)):?>
				<?=$this->image_Helper($images[0])->render(array('class'=>'lazy'));?>
			<?php else:?>
				<?=$this->image_Helper($images[0])->crop()->resize(280,150)->render(array('class'=>'lazy'));?>
			<?php endif;?>
		<?php endif;?>
		
		</a>
		<div class="news_resume">
		<?php if($item['text']!=''):?>
		<div class="news_date"><?php echo $date->toString('dd MMMM yyyy');?></div>
		
		 <a class="news_title" href="<?=$url ?>"><?=$this->escape($item['label'])?></a>    
		<?php endif;?>
		
		<?php echo $item['resume']?>
		</div>
	</div>
	<?php endforeach;?>
<? endif;?>
